<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>
        <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel="stylesheet" type="text/css" href="search/search.css" />
        <link rel="stylesheet" type="text/css" href="searchOverrides.css" />
        <script type="text/javascript" src="search/searchdata.js"></script>
        <script type="text/javascript" src="search/search.js"></script>
        <script type="text/javascript">
        /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
          $(document).ready(function() { init_search(); });
        /* @license-end */
        </script>
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML 2.6.1</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_c0a853e81d6f1c1f0a3eb7a27dc24256.html">SFML</a></li><li class="navelem"><a class="el" href="dir_89e9fb32471ae291b179a889144513db.html">Network</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">Packet.hpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">//</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">// SFML - Simple and Fast Multimedia Library</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment">// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment">//</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment">// This software is provided &#39;as-is&#39;, without any express or implied warranty.</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment">// In no event will the authors be held liable for any damages arising from the use of this software.</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment">//</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment">// Permission is granted to anyone to use this software for any purpose,</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment">// including commercial applications, and to alter it and redistribute it freely,</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment">// subject to the following restrictions:</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment">//</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">// 1. The origin of this software must not be misrepresented;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="comment">//    you must not claim that you wrote the original software.</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="comment">//    If you use this software in a product, an acknowledgment</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment">//    in the product documentation would be appreciated but is not required.</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="comment">//</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="comment">// 2. Altered source versions must be plainly marked as such,</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment">//    and must not be misrepresented as being the original software.</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="comment">//</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="comment">// 3. This notice may not be removed or altered from any source distribution.</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="comment">//</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="comment"></span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#ifndef SFML_PACKET_HPP</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#define SFML_PACKET_HPP</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="comment">// Headers</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="comment"></span><span class="preprocessor">#include &lt;SFML/Network/Export.hpp&gt;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="keyword">namespace </span>sf</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>{</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="keyword">class </span>String;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="keyword">class </span>TcpSocket;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="keyword">class </span>UdpSocket;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html">   47</a></span><span class="keyword">class </span>SFML_NETWORK_API <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>{</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    <span class="comment">// A bool-like type that cannot be converted to integer or pointer types</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    <span class="keyword">typedef</span> bool (<a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>::*BoolType)(std::size_t);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a786e5d4ced83992ceefa1799963ea858">   60</a></span>    <a class="code hl_function" href="classsf_1_1Packet.html#a786e5d4ced83992ceefa1799963ea858">Packet</a>();</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#adc0490ca3c7c3d1e321bd742e5213913">   66</a></span>    <span class="keyword">virtual</span> <a class="code hl_function" href="classsf_1_1Packet.html#adc0490ca3c7c3d1e321bd742e5213913">~Packet</a>();</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011">   78</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011">append</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, std::size_t sizeInBytes);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a5c2dc9878afaf30e88d922776201f6c3">   90</a></span>    std::size_t <a class="code hl_function" href="classsf_1_1Packet.html#a5c2dc9878afaf30e88d922776201f6c3">getReadPosition</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a133ea8b8fe6e93c230f0d79f19a3bf0d">  100</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="classsf_1_1Packet.html#a133ea8b8fe6e93c230f0d79f19a3bf0d">clear</a>();</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a998b70df024bee4792e2ecdc915ae46e">  115</a></span>    <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code hl_function" href="classsf_1_1Packet.html#a998b70df024bee4792e2ecdc915ae46e">getData</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a0fae6eccf2ca704fc5099cd90a9f56f7">  128</a></span>    std::size_t <a class="code hl_function" href="classsf_1_1Packet.html#a0fae6eccf2ca704fc5099cd90a9f56f7">getDataSize</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a61e354fa670da053907c14b738839560">  142</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="classsf_1_1Packet.html#a61e354fa670da053907c14b738839560">endOfPacket</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a8ab20be4a63921b7cb1a4d8ca5c30f75">  184</a></span>    <span class="keyword">operator</span> BoolType() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a8b6403506fec6b69f033278de33c8145">  190</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<span class="keywordtype">bool</span>&amp;         data);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a1c7814f9dbc637986ac498094add5ca5">  195</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Int8&amp;         data);</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a48df8986fc24551f1287144d3e990859">  200</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Uint8&amp;        data);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ae455be24bfd8dbaa4cd5097e0fb70ecd">  205</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Int16&amp;        data);</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a6bc20f1be9a63407079e6d26171ac71f">  210</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Uint16&amp;       data);</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span> </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a663e71b25a9352e3c4ddf4a3ce9db921">  215</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Int32&amp;        data);</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#aa3b0fabe6c14bcfa29bb04844b8bb987">  220</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Uint32&amp;       data);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span> </div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ae76105996a6c2217bb3a4571603e92f6">  225</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Int64&amp;        data);</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span> </div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a79f7c144fd07a4036ffc7b0870a36613">  230</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(Uint64&amp;       data);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a741849607d428e93c532e11eadcc39f1">  235</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<span class="keywordtype">float</span>&amp;        data);</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span> </div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a1854ca771105fb281edf349fc6507c73">  240</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<span class="keywordtype">double</span>&amp;       data);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span> </div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#aaed01fec1a3eae27a028506195607f82">  245</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<span class="keywordtype">char</span>*         data);</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span> </div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a60484dff69997db11e2d4ab3704ab921">  250</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(std::string&amp;  data);</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span> </div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a8805e66013f9f84ec8a883e42ae259d4">  255</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<span class="keywordtype">wchar_t</span>*      data);</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a8621056995c32bcf59809e2aecf08635">  260</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(std::wstring&amp; data);</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span> </div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a27d0ae92891dbf8a7914e5d5232940d0">  265</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &gt;&gt;(<a class="code hl_class" href="classsf_1_1String.html">String</a>&amp;       data);</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span> </div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ae02c874e0aac18a0497fca982a8f9083">  271</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keywordtype">bool</span>                data);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span> </div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a97aa4ecba66b8f528438fc41ed020825">  276</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Int8                data);</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ad5cc1857ed14878ab7a8509db8d99335">  281</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Uint8               data);</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span> </div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a9d9c5a1bef415046aa46d51e7d2a9f1c">  286</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Int16               data);</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span> </div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#afb6b2958f8a55923297da432c2a4f3e9">  291</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Uint16              data);</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span> </div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#af7f5c31c2d2749d3088783525f9fc974">  296</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Int32               data);</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ad1837e0990f71e3727e0e118ab9fd20e">  301</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Uint32              data);</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span> </div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a6dc89edcfcf19daf781b776439aba94a">  306</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Int64               data);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span> </div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#af3802406ed3430e20259e8551fa6554b">  311</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(Uint64              data);</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span> </div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#acf1a231e48452a1cd55af2c027a1c1ee">  316</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keywordtype">float</span>               data);</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#abee2df335bdc3ab40521248cdb187c02">  321</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keywordtype">double</span>              data);</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span> </div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a94522071d95189ddff1ae7ca832695ff">  326</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keyword">const</span> <span class="keywordtype">char</span>*         data);</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno">  327</span> </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ac45aab054ddee7de9599bc3b2d8e025f">  331</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keyword">const</span> std::string&amp;  data);</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span> </div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ac5a13e3280cac77799f7fdadfe3e37b6">  336</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keyword">const</span> <span class="keywordtype">wchar_t</span>*      data);</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span> </div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a97acaefaee7d3ffb36f4e8a00d4c3970">  341</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keyword">const</span> std::wstring&amp; data);</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno">  342</span> </div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#a5ef2e3308b93b80214b42a7d4683704a">  346</a></span>    <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; operator &lt;&lt;(<span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1String.html">String</a>&amp;       data);</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno">  347</span> </div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno">  349</span> </div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno">  350</span>    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code hl_class" href="classsf_1_1TcpSocket.html">TcpSocket</a>;</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span>    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code hl_class" href="classsf_1_1UdpSocket.html">UdpSocket</a>;</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span> </div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#af0003506bcb290407dcf5fe7f13a887d">  371</a></span>    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code hl_function" href="classsf_1_1Packet.html#af0003506bcb290407dcf5fe7f13a887d">onSend</a>(std::size_t&amp; size);</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span> </div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"><a class="line" href="classsf_1_1Packet.html#ab71a31ef0f1d5d856de6f9fc75434128">  390</a></span>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classsf_1_1Packet.html#ab71a31ef0f1d5d856de6f9fc75434128">onReceive</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, std::size_t size);</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno">  391</span> </div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span> </div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span>    <span class="keywordtype">bool</span> operator ==(<span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; right) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno">  399</span>    <span class="keywordtype">bool</span> operator !=(<span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Packet.html">Packet</a>&amp; right) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span> </div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span>    <span class="keywordtype">bool</span> checkSize(std::size_t size);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span> </div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span>    <span class="comment">// Member data</span></div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno">  416</span><span class="comment"></span>    std::vector&lt;char&gt; m_data;    </div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno">  417</span>    std::size_t       m_readPos; </div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno">  418</span>    std::size_t       m_sendPos; </div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno">  419</span>    <span class="keywordtype">bool</span>              m_isValid; </div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno">  420</span>};</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno">  421</span> </div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span>} <span class="comment">// namespace sf</span></div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span> </div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno">  424</span> </div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno">  425</span><span class="preprocessor">#endif </span><span class="comment">// SFML_PACKET_HPP</span></div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno">  426</span> </div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno">  427</span> </div>
<div class="ttc" id="aclasssf_1_1Packet_html"><div class="ttname"><a href="classsf_1_1Packet.html">sf::Packet</a></div><div class="ttdoc">Utility class to build blocks of data to transfer over the network.</div><div class="ttdef"><b>Definition</b> <a href="Packet_8hpp_source.html#l00047">Packet.hpp:48</a></div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a0fae6eccf2ca704fc5099cd90a9f56f7"><div class="ttname"><a href="classsf_1_1Packet.html#a0fae6eccf2ca704fc5099cd90a9f56f7">sf::Packet::getDataSize</a></div><div class="ttdeci">std::size_t getDataSize() const</div><div class="ttdoc">Get the size of the data contained in the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a133ea8b8fe6e93c230f0d79f19a3bf0d"><div class="ttname"><a href="classsf_1_1Packet.html#a133ea8b8fe6e93c230f0d79f19a3bf0d">sf::Packet::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Clear the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a5c2dc9878afaf30e88d922776201f6c3"><div class="ttname"><a href="classsf_1_1Packet.html#a5c2dc9878afaf30e88d922776201f6c3">sf::Packet::getReadPosition</a></div><div class="ttdeci">std::size_t getReadPosition() const</div><div class="ttdoc">Get the current reading position in the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a61e354fa670da053907c14b738839560"><div class="ttname"><a href="classsf_1_1Packet.html#a61e354fa670da053907c14b738839560">sf::Packet::endOfPacket</a></div><div class="ttdeci">bool endOfPacket() const</div><div class="ttdoc">Tell if the reading position has reached the end of the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a786e5d4ced83992ceefa1799963ea858"><div class="ttname"><a href="classsf_1_1Packet.html#a786e5d4ced83992ceefa1799963ea858">sf::Packet::Packet</a></div><div class="ttdeci">Packet()</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a7dd6e429b87520008326c4d71f1cf011"><div class="ttname"><a href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011">sf::Packet::append</a></div><div class="ttdeci">void append(const void *data, std::size_t sizeInBytes)</div><div class="ttdoc">Append data to the end of the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_a998b70df024bee4792e2ecdc915ae46e"><div class="ttname"><a href="classsf_1_1Packet.html#a998b70df024bee4792e2ecdc915ae46e">sf::Packet::getData</a></div><div class="ttdeci">const void * getData() const</div><div class="ttdoc">Get a pointer to the data contained in the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_ab71a31ef0f1d5d856de6f9fc75434128"><div class="ttname"><a href="classsf_1_1Packet.html#ab71a31ef0f1d5d856de6f9fc75434128">sf::Packet::onReceive</a></div><div class="ttdeci">virtual void onReceive(const void *data, std::size_t size)</div><div class="ttdoc">Called after the packet is received over the network.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_adc0490ca3c7c3d1e321bd742e5213913"><div class="ttname"><a href="classsf_1_1Packet.html#adc0490ca3c7c3d1e321bd742e5213913">sf::Packet::~Packet</a></div><div class="ttdeci">virtual ~Packet()</div><div class="ttdoc">Virtual destructor.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_af0003506bcb290407dcf5fe7f13a887d"><div class="ttname"><a href="classsf_1_1Packet.html#af0003506bcb290407dcf5fe7f13a887d">sf::Packet::onSend</a></div><div class="ttdeci">virtual const void * onSend(std::size_t &amp;size)</div><div class="ttdoc">Called before the packet is sent over the network.</div></div>
<div class="ttc" id="aclasssf_1_1String_html"><div class="ttname"><a href="classsf_1_1String.html">sf::String</a></div><div class="ttdoc">Utility string class that automatically handles conversions between types and encodings.</div><div class="ttdef"><b>Definition</b> <a href="String_8hpp_source.html#l00045">String.hpp:46</a></div></div>
<div class="ttc" id="aclasssf_1_1TcpSocket_html"><div class="ttname"><a href="classsf_1_1TcpSocket.html">sf::TcpSocket</a></div><div class="ttdoc">Specialized socket using the TCP protocol.</div><div class="ttdef"><b>Definition</b> <a href="TcpSocket_8hpp_source.html#l00046">TcpSocket.hpp:47</a></div></div>
<div class="ttc" id="aclasssf_1_1UdpSocket_html"><div class="ttname"><a href="classsf_1_1UdpSocket.html">sf::UdpSocket</a></div><div class="ttdoc">Specialized socket using the UDP protocol.</div><div class="ttdef"><b>Definition</b> <a href="UdpSocket_8hpp_source.html#l00045">UdpSocket.hpp:46</a></div></div>
</div><!-- fragment --></div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
                Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
